package com.cheems.cn.server;

import io.vertx.core.Vertx;
import lombok.extern.slf4j.Slf4j;

/**
 * @author JTB
 */
@Slf4j
public class VertxHttpServer implements HttpServer{
    @Override
    public void doStart(int port) {

        Vertx vertx = Vertx.vertx();
        io.vertx.core.http.HttpServer server = vertx.createHttpServer();

        server.requestHandler(new httpServerHandler());

        server.listen(port , result -> {
            if (result.succeeded()) {
                System.out.println("启动成功 监听端口:" + port);
            } else {
                System.out.println("启动失败" + result.cause());
            }
        });
    }
}
